# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=yazi
pkgver=0.1.5
pkgrel=0
pkgdesc="Blazing fast terminal file manager written in Rust, based on async I/O."
url="https://yazi-rs.github.io"
arch="all !ppc64le !riscv64" # luajit
license="MIT"
makedepends="
	cargo
	cargo-auditable
	luajit-dev
"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/sxyazi/yazi/archive/refs/tags/v$pkgver.tar.gz
	system-luajit.patch
"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/yazi "$pkgdir"/usr/bin/yazi

	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
d36c5992fea4baa5ccbbac3d60ff0a61a81e6a8b7e79b358b77f4338c98df147b6571a2aae360dcef50fbac862b81fbf067f36b2347d458c86f58ff715942514  yazi-0.1.5.tar.gz
a87b8527b5cc3e879a573c776e173a78f5d1f6b523f2a8d603b6f80437adf6a2907cc29b28473ee926eb3518de45f2341cb3cbf8b6e0aeb182cd75e5d5982235  system-luajit.patch
"
